package com.pointi.emoClientM;

import java.text.SimpleDateFormat;
import java.util.Date;

public class CheckStatus
{
	String _ClientNo ;
	private long _StartTime ;
	private long _RunningTime ;
	private int _Count ;
	private int _CheckInterval ;

	public CheckStatus(String inClientNo, String inCheckInterval)
	{
		_ClientNo = inClientNo ;
		_Count = 0 ;
		_CheckInterval = Integer.valueOf(inCheckInterval) ;
		this.fnResetTime() ;
	}

	public boolean isNewDate()
	{
		String referenceTime = "00" ;
		String currentTime = "" ;
		SimpleDateFormat sdf = new SimpleDateFormat("HH") ; // [OPTION] HH(00~23) or kk(01~24)
		currentTime = sdf.format(new Date()) ;
		return currentTime.equals(referenceTime) ;
	}
	public void fnResetTime()
	{
		_StartTime = System.currentTimeMillis() ;
		_RunningTime = System.currentTimeMillis() ;
	}
	public void fnSetClientCount(int inCount) { _Count = inCount ; }
	public void fnSetRunningTime() { _RunningTime = System.currentTimeMillis() - _StartTime ; }
	public int fnGetCheckInterval() { return _CheckInterval ; }
	public String fnGetClientNo() { return _ClientNo ; }
	public String fnGetClientStatus() { return String.valueOf(_RunningTime / 1000) ; }
	public String fnGetClientCount() { return String.valueOf(_Count) ; }
}